<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.util.Info"%>
<%@page import="com.dao.CommonDAO"%>
<%@page import="com.util.PageManager"%>
<%@page import="com.model.Sysuser"%>
<%@page import="com.model.Menuinfo"%>
<%@page import="com.model.Userrole"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>管理页面</title>
<!-- 调用CSS，JS -->
<link href="/wearablehealthymonitorsys/admin/images/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	font-family: "宋体";
	font-size: 12px;
	color: #333333;
	background-color: ;
}
.STYLE1 {
	color: #333333;
	font-size: x-large;
	font-family: Arial, Helvetica, sans-serif;
}
-->
</style>
<script language="javascript">
function window.onload() { 

if(top.location != self.location){ 

var a = window.parent.document.getElementsByTagName('iframe'); 

for (var i=0; i<a.length; i++){ 

if (a[i].name == self.name) {a[i].height = document.body.scrollHeight+320; return;}}} 
} 
</script>
<script language=javascript>
function show(no)
{
for(var i=1;i<20;i++)
{
var a = document.getElementById(no+"@"+i);
if(a==null)
{
continue;
}
if(a.style.display=="")
{
a.style.display="none";
}else{
a.style.display="";
}
}

}
</script>
<script type="text/javascript">
function showzhi(inn)
{
var a = document.getElementById("loca");
a.innerHTML=inn;
}
function change(no)
{
var c = document.getElementById("c");
c.innerHTML=no;
}
</script>

</head>
<body>
  <% 
  CommonDAO dao = (CommonDAO)Info.getDao(request,"CommonDAO");
  Sysuser user = (Sysuser)session.getAttribute("user"); 
  %>


<form id="form1" name="form1" method="post" action="rolemgr.jsp?f=f">


<br />


						<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#BBD3EB">
                          <tr>
                          <td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">角色</td>
                          <td height="27" align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">权限</td>
                            <td align="center" background="/wearablehealthymonitorsys/admin/images/index1_72.gif" bgcolor="#FFFFFF">操作</td>
    </tr>
                         
                         
                       
                          <tr>
                            <td height="26" align="center" bgcolor="#FFFFFF">管理员</td>
                           <td height="26" align="left" bgcolor="#FFFFFF">
                           <%
                           String hql1 = " from Userrole  where utype='管理员'";
                           ArrayList<Userrole> list1 = (ArrayList<Userrole>)dao.findByHql(hql1); 
                           for(Userrole ur1:list1){
                        	   if(!ur1.getRole().equals("")){
                        	   Menuinfo mi1 = (Menuinfo)dao.findById(ur1.getRole(),"Menuinfo");
                           %>
                           [<%=mi1.getMenuname() %>]
                           <%}} %>
                           </td>
                            <td height="26" align="center" bgcolor="#FFFFFF">
                            <a href="roleedit.jsp?utype=1">授权</a>
                            </td>
                          </tr>
                          <tr>
                            <td height="26" align="center" bgcolor="#FFFFFF">医生</td>
                           <td height="26" align="left" bgcolor="#FFFFFF">
                           <%
                           String hql2 = " from Userrole  where utype='医生'";
                           ArrayList<Userrole> list2 = (ArrayList<Userrole>)dao.findByHql(hql2); 
                           for(Userrole ur2:list2){
                        	   if(!ur2.getRole().equals("")){
                        	   Menuinfo mi2 = (Menuinfo)dao.findById(ur2.getRole(),"Menuinfo");
                           %>
                           [<%=mi2.getMenuname() %>]
                           <%}} %>
                           </td>
                            <td height="26" align="center" bgcolor="#FFFFFF">
                            <a href="roleedit.jsp?utype=2">授权</a>
                            </td>
                          </tr>
                          <tr>
                            <td height="26" align="center" bgcolor="#FFFFFF">护工</td>
                           <td height="26" align="left" bgcolor="#FFFFFF">
                           <%
                           String hql3 = " from Userrole  where utype='护工'";
                           ArrayList<Userrole> list3 = (ArrayList<Userrole>)dao.findByHql(hql3); 
                           for(Userrole ur3:list3){
                        	   if(!ur3.getRole().equals("")){
                        	   Menuinfo mi3 = (Menuinfo)dao.findById(ur3.getRole(),"Menuinfo");
                           %>
                           [<%=mi3.getMenuname() %>]
                           <%}} %>
                           </td>
                            <td height="26" align="center" bgcolor="#FFFFFF">
                            <a href="roleedit.jsp?utype=3">授权</a>
                            </td>
                          </tr>
                          
                        
</table>      
</form>                 
</body>
</html>
